/******************************************************************************
 * Copyright 2023 The Apollo Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/

#pragma once

#include "modules/canbus_vehicle/x3epro/proto/x3epro.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"

namespace apollo {
namespace canbus {
namespace x3epro {

class Lighthornreport362 : public ::apollo::drivers::canbus::ProtocolData<
                    ::apollo::canbus::X3epro> {
 public:
  static const int32_t ID;
  Lighthornreport362();
  void Parse(const std::uint8_t* bytes, int32_t length,
                     X3epro* chassis) const override;

 private:
    // config detail: {'bit': 6, 'enum': {0: 'EMERGENCYSTOP_STATUS_OFF', 1: 'EMERGENCYSTOP_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'EmergencyStop_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::EmergencyStop_statusType emergencystop_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 7, 'enum': {0: 'BRAKELAMP_STATUS_OFF', 1: 'BRAKELAMP_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'BrakeLamp_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Brakelamp_statusType brakelamp_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 8, 'enum': {0: 'TURN_RIGHT_LIGHT_STATUS_OFF', 1: 'TURN_RIGHT_LIGHT_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'Turn_Right_Light_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Turn_right_light_statusType turn_right_light_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 9, 'enum': {0: 'TURN_LEFT_LIGHT_STATUS_OFF', 1: 'TURN_LEFT_LIGHT_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'Turn_Left_Light_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Turn_left_light_statusType turn_left_light_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 10, 'enum': {0: 'HORN_STATUS_OFF', 1: 'HORN_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'Horn_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Horn_statusType horn_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 11, 'enum': {0: 'DAYLAMP_STATUS_OFF', 1: 'DAYLAMP_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'DayLamp_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Daylamp_statusType daylamp_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 12, 'enum': {0: 'HEADBEAM_STATUS_OFF', 1: 'HEADBEAM_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'HeadBeam_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Headbeam_statusType headbeam_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 13, 'enum': {0: 'POSITIONLAMP_STATUS_OFF', 1: 'POSITIONLAMP_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'PositionLamp_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Positionlamp_statusType positionlamp_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 14, 'enum': {0: 'FROGLAMP_STATUS_OFF', 1: 'FROGLAMP_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'FrogLamp_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Froglamp_statusType froglamp_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 15, 'enum': {0: 'HIGHBEAM_STATUS_OFF', 1: 'HIGHBEAM_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'HighBeam_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Highbeam_statusType highbeam_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 16, 'enum': {0: 'PROJECTOR_STATUS_OFF', 1: 'PROJECTOR_STATUS_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'Projector_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Projector_statusType projector_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 17, 'enum': {0: 'LIGHT_SENSOR_ENABLE_DISABLE', 1: 'LIGHT_SENSOR_ENABLE_ENABLE'}, 'is_signed_var': False, 'len': 1, 'name': 'Light_Sensor_Enable', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Light_sensor_enableType light_sensor_enable(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 19, 'enum': {0: 'WARNINGLAMP_STATUS_OFF', 1: 'WARNINGLAMP_STATUS_ON'}, 'is_signed_var': False, 'len': 2, 'name': 'WarningLamp_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Warninglamp_statusType warninglamp_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 20, 'enum': {0: 'CLEANERRELAY_105_OFF', 1: 'CLEANERRELAY_105_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'CleanerRelay_105', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Light_horn_report_362::Cleanerrelay_105Type cleanerrelay_105(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 43, 'is_signed_var': False, 'len': 4, 'name': 'SD_AliveCounter', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'int'}
    int sd_alivecounter(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 51, 'is_signed_var': False, 'len': 4, 'name': 'AD_AliveCounter', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'int'}
    int ad_alivecounter(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name': 'CheckSum', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'int'}
    int checksum(const std::uint8_t* bytes, const int32_t length) const;
};

}  // namespace x3epro
}  // namespace canbus
}  // namespace apollo


